<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>Form Elements - Ace Admin</title>

<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<!-- bootstrap & fontawesome -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/font-awesome.min.css" />

<!-- page specific plugin styles -->
		<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/colorbox.min.css" />

<!-- page specific plugin styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/jquery-ui.custom.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/chosen.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datepicker3.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-timepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/daterangepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/bootstrap-colorpicker.min.css" />


<!-- ace styles -->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace.min.css"
	id="main-ace-style" />

<!--[if lte IE 9]>
			<link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-part2.min.css" />
		<![endif]-->
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-skins.min.css" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/ace/assets/css/ace-rtl.min.css" />

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="<%=request.getContextPath()%>/ace/assets/css/ace-ie.min.css" />
		<![endif]-->

<!-- inline styles related to this page -->

<!-- ace settings handler -->
<script
	src="<%=request.getContextPath()%>/ace/assets/js/ace-extra.min.js"></script>

<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="<%=request.getContextPath()%>/ace/assets/js/html5shiv.min.js"></script>
		<script src="<%=request.getContextPath()%>/ace/assets/js/respond.min.js"></script>
		<![endif]-->

<script
	src="<%=request.getContextPath()%>/ace/assets/js/jquery-2.1.4.min.js"></script>
</head>

<body class="no-skin">
	

	<!-- /section:basics/content.breadcrumbs -->
	<div class="page-content">
		<!-- /section:settings.box -->
		<div class="page-content-area">
			<div class="page-header">
				<h1>
					专家审核 
				</h1>
			</div>
			<!-- /.page-header -->

			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					<form id="drizzt-table" class="form-horizontal"
						action="<%=request.getContextPath()%>/bsbApplyExpert/update.do"
						method="post">
						<!-- #section:elements.form -->
								<input type="hidden"   name="uuid" value="${bsbApplyExpert.uuid}"
									class="col-xs-10 col-sm-5" />
								
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 姓名 </label>
		
									<div class="col-sm-9">
										<input type="text"   placeholder="name"
											name="name" value="${bsbApplyExpert.name}" readonly="readonly"
											class="col-xs-10 col-sm-5" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 头衔 </label>
		
									<div class="col-sm-9">
										<input type="text"   placeholder="duty"
											name="duty" value="${bsbApplyExpert.duty}" readonly="readonly"
											class="col-xs-10 col-sm-5" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 从业年限 </label>
		
									<div class="col-sm-9">
										<input type="text"   placeholder="year"
											name="year" value="${bsbApplyExpert.year}" readonly="readonly"
											class="col-xs-10 col-sm-5" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 咨询价格 </label>
		
									<div class="col-sm-9">
										<input type="text"   placeholder="advicePrice"
											name="advicePrice" value="${bsbApplyExpert.advicePrice}" readonly="readonly"
											class="col-xs-10 col-sm-5" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 擅长课程 </label>
		
									<div class="col-sm-9">
										<textarea name="skill" id="skill" class="autosize-transition form-control">${bsbApplyExpert.skill}</textarea>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 个人简介 </label>
		
									<div class="col-sm-9">
											<textarea name="profile" id="profile" class="autosize-transition form-control">${bsbApplyExpert.profile}</textarea>
									</div>
								</div>
								
								
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 资格证件 </label>
		
									<div class="col-sm-9">
										<ul class="ace-thumbnails clearfix">
											<c:forEach items="${imgs}" var="img">
												<li>
													<a href="<%=request.getContextPath()%>/getPic/${img}" data-rel="colorbox">
														<img width="150" height="150" alt="150x150" src="<%=request.getContextPath()%>/getPic/${img}" />
													</a>

												</li>
											</c:forEach>
										</ul>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right"
										for="form-field-1"> 附件</label>
		
									<div class="col-sm-9">
											<a href="<%=request.getContextPath()%>/bsbApplyExpert/downresume/${bsbApplyExpert.uuid}">${bsbApplyExpert.formerFile}</a>
									</div>
								</div>
								
						<div class="clearfix form-actions">
							<div class="col-md-offset-3 col-md-3">
								<input type="button" class="btn btn-info" onclick="javascript:pass($('#skill').val(),$('#profile').val())" value="通过" />
							</div>
							<div class="col-md-offset-1 col-md-3">
								<input type="button" class="btn btn-info" onclick="javascript:nopass()" value="不通过" />
							</div>
						</div>
					</form>

					<!-- PAGE CONTENT ENDS -->
				</div>
				<!-- /.col -->
			</div>
			<!-- /.row -->
		</div>
		<!-- /.page-content-area -->
	</div>
	<!-- /.page-content -->
</body>

<!-- basic scripts -->

<!--[if !IE]> -->
<script type="text/javascript">
	window.jQuery
			|| document
					.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.min.js'>"
							+ "<"+"/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
	if ('ontouchstart' in document.documentElement)
		document.write("<script src='<%=request.getContextPath()%>/ace/assets/js/jquery.mobile.custom.min.js'>"+ "<"+"/script>");
</script>

<script
	src="<%=request.getContextPath()%>/ace/assets/js/bootstrap.min.js"></script>
<script src="<%=request.getContextPath()%>/ace/assets/js/bootbox.js"></script>

<script type="text/javascript">
function pass(skill,profile){
	var url = "<%=request.getContextPath()%>/bsbApplyExpert/${bsbApplyExpert.uuid}/pass";
	
	$.ajax({
    	url : url,
    	type : 'GET',
    	dataType : "json",
    	data :  {"skill":skill,"profile":profile},
    	success : function(data) {
	    	if(data.status){
	    		bootbox.confirm({
	    		    message: "<b>审核成功，是否发送短信通知用户</b><br><b>内容：</b>恭喜您，您申请的办税宝专家已通过审核，请登录办税宝APP查看。",
	    		    buttons: {
	    		        confirm: {
	    		            label: '立即发送',
	    		            className: 'btn-success'
	    		        },
	    		        cancel: {
	    		            label: '不发送',
	    		            className: 'btn-danger'
	    		        }
	    		    },
	    		    callback: function (result) {
	    		       if(result){
	    		    	   $.ajax({
	    		    		   url : "<%=request.getContextPath()%>/bsbApplyExpert/${bsbApplyExpert.uuid}/notify",
	    				    	type : 'GET',
	    				    	dataType : "json",
	    				    	success : function(data) {
	    				    		console.log(data);
	    				    		if(data.status){
	    				    			bootbox.alert(data.msg);
	    				    		}else{
	    				    			console.log(data.msg);
	    				    		}
		    						window.location.href="<%=request.getContextPath()%>/bsbApplyExpert/list";
	    				    	}
	    		    	   });
	    		       }else{
			    		window.location.href="<%=request.getContextPath()%>/bsbApplyExpert/list";
	    		       };
	    		    }
	    		});
	    		
	    	}else{
	    		bootbox.alert(data.msg);
	    	}
    	}
    	});
}
</script>
<script type="text/javascript">
function nopass(){
	var url = "<%=request.getContextPath()%>/bsbApplyExpert/${bsbApplyExpert.uuid}/nopass";
	bootbox.prompt({
	    title: "<b>请输入不通过理由，该理由将以短信形式发送给用户! 格式如下：</b><br>您提交的办税宝专家申请因（）原因，审核未被通过，请修改申请资料后重新提交。<font color='red'>请补充括弧内的内容</font>",
	    inputType: 'textarea',
	    callback: function (result) {
	    	if(result == null){
	    		return;
	    	}else if(result == ''){
	    		bootbox.alert("不通过理由不能为空!");
	    		return;
	    	}
			$.ajax({
		    	url : url,
		    	type : 'GET',
		    	dataType : "json",
		    	data :  {"reason":result},
		    	success : function(data) {
			    	if(data.status){
			    		//bootbox.confirm(data.msg, function(result){ window.location.href="<%=request.getContextPath()%>/bsbApplyExpert/list";});
			    		bootbox.confirm({
			    		    message: "<b>审核成功，是否发送短信通知用户</b><br><b>内容：</b>您提交的办税宝专家申请因"+result+"原因，审核未被通过，请修改申请资料后重新提交。",
			    		    buttons: {
			    		        confirm: {
			    		            label: '立即发送',
			    		            className: 'btn-success'
			    		        },
			    		        cancel: {
			    		            label: '不发送',
			    		            className: 'btn-danger'
			    		        }
			    		    },
			    		    callback: function (yes) {
			    		       if(yes){
			    		    	   $.ajax({
			    		    		   url : "<%=request.getContextPath()%>/bsbApplyExpert/${bsbApplyExpert.uuid}/refuse",
			    				    	type : 'GET',
			    				    	dataType : "json",
			    				    	data :  {"reason":result},
			    				    	success : function(data) {
			    				    		if(data.status){
			    				    			bootbox.alert(data.msg);
			    				    		}else{
			    				    			console.log(data.msg);
			    				    		}
						    				window.location.href="<%=request.getContextPath()%>/bsbApplyExpert/list";
			    				    	}
			    		    	   });
			    		       }else{
						    		window.location.href="<%=request.getContextPath()%>/bsbApplyExpert/list";
			    		       }
			    		    }
			    		});
			    	}else{
			    		bootbox.alert(data.msg);
			    	}
		    	}
		    	});
	       
	    }
	});
}
</script>
<script type="text/javascript" src="<%=request.getContextPath()%>/ace/assets/js/jquery.colorbox.min.js"></script>
<!-- ace scripts -->
<script src="<%=request.getContextPath()%>/ace/assets/js/ace-elements.min.js"></script>
<script src="<%=request.getContextPath()%>/ace/assets/js/ace.min.js"></script>
<!-- inline scripts related to this page 图片展示-->
<script type="text/javascript">
			jQuery(function($) {
	var $overflow = '';
	var colorbox_params = {
		rel: 'colorbox',
		scalePhotos:true,
		scrolling:false,
		previous:'<i class="ace-icon fa fa-arrow-left"></i>',
		next:'<i class="ace-icon fa fa-arrow-right"></i>',
		close:'&times;',
		current:'{current} of {total}',
		maxWidth:'100%',
		maxHeight:'100%',
		onOpen:function(){
			$overflow = document.body.style.overflow;
			document.body.style.overflow = 'hidden';
		},
		onClosed:function(){
			document.body.style.overflow = $overflow;
		},
		onComplete:function(){
			$.colorbox.resize();
		}
	};

	$('.ace-thumbnails [data-rel="colorbox"]').colorbox(colorbox_params);
	$("#cboxLoadingGraphic").html("<i class='ace-icon fa fa-spinner orange fa-spin'></i>");//let's add a custom loading icon
	
	
	$(document).one('ajaxloadstart.page', function(e) {
		$('#colorbox, #cboxOverlay').remove();
   });
})
		</script>
</html>
